<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>js 的对象</title>
		<script>
			class Dog{
				constructor(name,sex,age){
					this._name=name;
					this.sex=sex;
					this.age=age;
				}
				show(){
					alert("这个狗叫"+this._name+","+this.sex+","+this.age);
				}
				bite(o){
					alert(this._name+"咬了"+o);
				}
			}
			class ZangAo extends Dog{
				constructor(name,sex,age,w){
					super(name,sex,age);
					this.weight=w;
				}
				show(){
					super.show();
					alert("体重是"+this.weight+"kg");
				}
			}
			// var d=new Dog("大黄","公",5);
			
			// d.show();
			// d.bite("马啸博");
			
			var d2=new ZangAo("二黄","母",5,19);
			d2.age=20;
			d2._name="翠花";
			d2.show();
			d2.bite("定国");
			
			alert(d2 instanceof Dog);
		</script>
	</head>
	<body>
	</body>
</html>